package cn.slipi.service.service.impl;

import cn.slipi.service.entity.TMessage;
import cn.slipi.service.dao.TMessageMapper;
import cn.slipi.service.service.TMessageService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 消息服务表 服务实现类
 * </p>
 *
 * @author lee
 * @since 2021-05-09
 */
@Service
public class TMessageServiceImpl extends ServiceImpl<TMessageMapper, TMessage> implements TMessageService {

    @Override
    public TMessage getMessageByObjId(String objId) {
        QueryWrapper<TMessage> messageQueryWrapper = new QueryWrapper<>();
        messageQueryWrapper.eq("obj_id", objId);
        messageQueryWrapper.eq("status", 1);
        return this.baseMapper.selectOne(messageQueryWrapper);
    }
}
